<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>一卡通网站管理员登陆</title>
<script type="text/javascript" src="${appPath}/common/common.js"></script>
<style type="text/css">
<!--
		body {
			font-size:12px;
			margin-left: 0px;
			margin-top: 0px;
			margin-right: 0px;
			margin-bottom: 0px;
			background-color: #1D3647;
		}
		/**验证码***/
        .code
        {
            background-image:url(code.jpg);
            font-family:Arial;
            font-style:italic;
            color:Red;
            border:0;
            padding:2px 3px;
            letter-spacing:3px;
            font-weight:bolder;
        }
        .unchanged
        {
            border:0;
        }
-->
</style>

<script language="JavaScript">
//设置PNG图片透明
function correctPNG()
{
    var arVersion = navigator.appVersion.split("MSIE")
    var version = parseFloat(arVersion[1])
    if ((version >= 5.5) && (document.body.filters)) 
    {
       for(var j=0; j<document.images.length; j++)
       {
          var img = document.images[j]
          var imgName = img.src.toUpperCase()
          if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
          {
             var imgID = (img.id) ? "id='" + img.id + "' " : ""
             var imgClass = (img.className) ? "class='" + img.className + "' " : ""
             var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
             var imgStyle = "display:inline-block;" + img.style.cssText 
             if (img.align == "left") imgStyle = "float:left;" + imgStyle
             if (img.align == "right") imgStyle = "float:right;" + imgStyle
             if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
             var strNewHTML = "<span " + imgID + imgClass + imgTitle
             + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
             + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
             + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
             img.outerHTML = strNewHTML
             j = j-1
          }
       }
    }    
}
window.attachEvent("onload", correctPNG);
</script>
<script type="text/javascript">
var code ; //在全局 定义验证码
//生成验证码
function createCode(){ 
		code = "";
		var codeLength = 6;//验证码的长度
		var checkCode = document.getElementById("checkCode");
		var selectChar = 
	  		new Array(0,1,2,3,4,5,6,7,8,9,'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');//所有候选组成验证码的字符，当然也可以用中文的

		for(var i=0;i<codeLength;i++){
			var charIndex = Math.floor(Math.random()*36);
			code +=selectChar[charIndex];
	    }
		if(checkCode){
		checkCode.className="code";
		checkCode.value = code;
		}  
}

//检查验证码
	function validate (){
		var inputCode = document.getElementById("yanzh").value;
		if(inputCode.length <=0){
		alert("请输入验证码！");
		return false;
		}else if(inputCode != code ){
		alert("验证码输入错误！");
		createCode();//刷新验证码
		return false;
		}else{
		return true;
		}
	 }
//登陆验证
	function loginMerch(){
	if(document.getElementById("user.username").value.trim().length == 0){
		alert('用户名不能为空！');
		return;
	}
	if(document.getElementById("user.pwd").value.trim().length == 0){
		alert('密码不能为空!');
		return;
	}
	if(!validate()){
		return;
	}
	document.getElementById("loginform").submit();		
	}
</script>
<link href="${backPath}/images/skin.css" rel="stylesheet" type="text/css">
</head>
<body>
${username}
<table width="100%" height="166" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="42" valign="top"><table width="100%" height="42" border="0" cellpadding="0" cellspacing="0" class="login_top_bg">
      <tr>
        <td width="1%" height="21">&nbsp;</td>
        <td height="42">&nbsp;</td>
        <td width="17%">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td valign="top"><table width="100%" height="532" border="0" cellpadding="0" cellspacing="0" class="login_bg">
      <tr>
        <td width="49%" align="right"><table width="91%" height="532" border="0" cellpadding="0" cellspacing="0" class="login_bg2">
            <tr>
              <td height="138" valign="top"><table width="89%" height="427" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td height="175">&nbsp;</td>
                </tr>
                <tr>
                  <td align="right" valign="top"><img src="${backPath}/images/logo.png" width="400" height="167"></td>
                </tr>
                <tr>
                  <td align="right" valign="top">&nbsp;</td>
                </tr>
              </table></td>
            </tr>
            
        </table></td>
        <td width="1%" >&nbsp;</td>
        <td width="50%" valign="bottom"><table width="100%" height="59" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="4%">&nbsp;</td>
              <td width="96%" height="38"><span class="login_txt_bt">登陆信息网后台管理</span></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td height="21"><table cellSpacing="0" cellPadding="0" width="100%" border="0" id="table211" height="328">
                  <tr>
                    <td height="164" colspan="2" align="middle">
                    	<form name="loginform" action="${backPath}/login.action" method="post">
                        <table cellSpacing="0" cellPadding="0" width="100%" border="0" height="143" id="table212">
                          <tr>
                            <td width="13%" height="38" class="top_hui_text"><span class="login_txt">管理员：&nbsp;&nbsp; </span></td>
                            <td height="38" colspan="2" class="top_hui_text"><input id="user.username" name="user.username" class="editbox4" value="admin" size="20"></td>
                          </tr>
                          <tr>
                            <td width="13%" height="35" class="top_hui_text"><span class="login_txt"> 密  &nbsp;&nbsp;码： &nbsp;&nbsp; </span></td>
                            <td height="35" colspan="2" class="top_hui_text"><input id="user.pwd" class="editbox4" type="password" size="20" name="user.pwd">
                              <img src="${backPath}/images/luck.gif" width="19" height="18"> </td>
                          </tr>
                          <tr>
                            <td width="13%" height="35" class="top_hui_text"><span class="login_txt"> 验证码：&nbsp;&nbsp; </span></td>
                            <td height="35" colspan="2" class="top_hui_text">
                            	<input name="yanzh" type="text" id="yanzh" size="8" onclick="createCode()"  />
								<input type="text"  id="checkCode" class="unchanged" style="width: 80px"  readonly/>
                            </td>
                          </tr>
                          <tr>
                            <td height="35" >&nbsp;</td>
                            <td width="20%" height="35" ><input type="button" class="button" id="Submit" value="登 陆" onclick="loginMerch()"> </td>
                            <td width="67%" class="top_hui_text"><input  type="reset" class="button" id="cs" value="重 置"></td>
                          </tr>
                          <tr>
                          	<td colspan="3">
                          		<font color="red" style="font-size:12px"><s:actionerror/></font>
                          	</td>
                          </tr>
                        </table>
                        <br>
                    </form></td>
                  </tr>
                  <tr>
                    <td width="433" height="164" align="right" valign="bottom"><img src="${backPath}/images/login-wel.gif" width="242" height="138"></td>
                    <td width="57" align="right" valign="bottom">&nbsp;</td>
                  </tr>
              </table></td>
            </tr>
          </table>
          </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="20"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="login-buttom-bg">
      <tr>
        <td align="center"><span class="login-buttom-txt">Copyright &copy; 2009-2010 www.nccsjz.com</span></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>